package com.gaber.extend;

/**
 * @author gaber
 * @date 2023/7/11 9:53:01
 * @description 老鼠类
 */
public class Mouse extends Animal{

    private String name;
    private int id;

    public Mouse(String myName, int myid) {
        super(myName, myid);
        name = myName;
        id = myid;
    }
    public void eatTest() {
        this.eat();   // this 调用自己的方法
        super.eat();  // super 调用父类方法
    }
    public void eat() {
        System.out.println(name+"子类正在吃");
    }
    public void sleep() {
        System.out.println(name+"正在睡");
    }
    public void introduction() {
        System.out.println("大家好！我是"+ id +"号"+name+".");
    }
}
